﻿#pragma once

#ifndef PLOTAREA_H
#define PLOTAREA_H
#include <qgesture.h>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_panner.h>
#include <qwt_plot.h>

class QwtPlotCurve;

//QT_BEGIN_NAMESPACE
//namespace Ui { class PlotArea; }
//QT_END_NAMESPACE

class PlotArea : public QwtPlot {
	Q_OBJECT

public:
	PlotArea(QWidget* = nullptr);

	double* m_pLambda = nullptr;
	double* l_pSpectrum = nullptr;

	QSize sizeHint() const { return QSize(100, 100); }
	QSize minimumSizeHint() const { return QSize(100, 100); }
private:
	QwtPlotCurve* curve;
	QwtPlotZoomer* zoomer;
	QwtPlotPanner* panner;

public:
	void update_plot(double* x, double* y, unsigned int nrPixel);
	void setPixelScale(unsigned int xLimit);

protected:
	void mouseDoubleClickEvent(QMouseEvent* event);
private slots:
};
#endif // PLOTAREA_H
